﻿using System.Web.Mvc;

namespace CID.Web.Support.Ajax
{
    public sealed class AjaxRedirectResult : AjaxActionResult
    {
        public override string Type { get { return "Redirect"; } }
        public string Url { get; set; }

        public AjaxRedirectResult(RedirectResult redirectResult)
        {
            Url = redirectResult.Url;
        }

        public AjaxRedirectResult(RedirectToRouteResult redirectResult, UrlHelper urlHelper)
        {
            Url = urlHelper.RouteUrl(redirectResult.RouteValues);
        }
    }
}